package com.thirteen.app.dao;

import com.thirteen.app.entity.Question;
import com.thirteen.app.entity.QuestionTypeQuestion;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 题目类型关联题目(Questiontypequestion)表数据库访问层
 *
 * @author 郑清林
 * @since 2021-09-06 14:20:43
 */
public interface QuestionTypeQuestionDao {
    /**
     * 新增数据
     */
    int insert(QuestionTypeQuestion questionTypeQuestion);

    //    查出该大题下所有小题Id
    List<Question> queryQuestion(Integer questionTypeId);

    //    查出此题分数
    Integer queryQuestionScore(@Param("questionId") Integer questionId, @Param("questionTypeId") Integer questionTypeId);

    //    插入题目和大题关联
    Boolean insertQuestionTypeQuestionForCreate(@Param("questionId") Integer questionId, @Param("questionTypeId") Integer questionTypeId, @Param("score") Integer score);


    List<Integer> selectRandom(Integer questionTypeId, Integer questionCount);

    //    查询答题数量
    Integer queryQuestionAnsweredCount();

}

